home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
cppfos.zip
/
FOSSIL.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1991-05-21
|
41KB
|
1,829 lines
// Module //
// Contents -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// FOSSIL.CPP
//
// Copyright (C) 1991 by J.R.Louvau
// All rights reserved.
//
// License
//
// This source code is freely available, copyrighted material.
// You are free to incorporate it into other software you are developing
// in original or modified form. You may also distribute it in any way
// you see fit, provided you follow these guidelines:
// 1) The contents of the header (".hpp") and source (".cpp") remain
// in their original form.
// 2) You don't make a profit.
// 3) Charging for a package you have developed which incorporates
// these routines in BINARY (.obj, .exe, etc.) is fine, but you may
// NOT include this SOURCE CODE in any for-profit package.
//
// Warranties, Liabilities, etc. ad nauseum
//
// None! It works on my compiler, hardware, modem, etc. If it works
// for you, great... if not, well, that's why you got the source code -
// so that YOU could fix it ;-) You can't get blood from a turnip,
// and I'm a turnip. Help save the environment: starve a lawyer.
//
// Description
//
// Implementation routines for class Fossil.
//
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Interface Dependencies -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "fossil.hpp"
// End Interface Dependencies -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Implementation Dependencies =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include <dos.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
// End Implementation Dependencies =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Constructor //
FosIo::FosIo()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None
//
// Return Value
//
// None
//
// Functional Description
//
// Empty constructor
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Destructor
FosIo::~FosIo()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None
//
// Return Value
//
// None
//
// Functional Description
//
// Empty destructor
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int FosIo::stringToSetup(char * _s)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// A serial port setup string in the form:
//
// <baud_rate>,<data_bits>,<parity>,<stop_bits>
//
// eg.:
//
// "19200,8,N,1"
//
// Return Value
//
// A bimasked value that can be bassed to a port setup routine.
// This is in the same basic format as a DOS INT 14h baudrate
// paramater.
//
// Functional Description
//
// Parses the given string into a bitmask value.
//
// Remarks
//
// The paramater string is NOT case sensitive.
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
char * p = _s;
unsigned long int _baud = atol(p);
p = strchr(p,',') + 1;
char _data = atoi(p);
p = strchr(p,',') + 1;
char _pari = *p;
p = strchr(p,',') + 1;
char _stop = atoi(p);
return (valuesToSetup(_baud,_data,_pari,_stop));
};
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int FosIo::valuesToSetup(unsigned long int _baudrate,
unsigned char _databits,
unsigned char _parity,
unsigned char _stopbits)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Serial port settings for baud, data-bits (word length), parity
// and stop-bits.
// Parity is passed as an ASCII character like: 'E' == even parity.
//
// Return Value
//
// A bimasked value that can be bassed to a port setup routine.
// This is in the same basic format as a DOS INT 14h baudrate
// paramater.
//
// Functional Description
//
// Converts the supplied paramaters to a bitmask.
//
// Remarks
//
// The paramater string is NOT case sensitive.
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
unsigned int _pmask = 0U;
_pmask |= ((_baudrate == 300L ) ? b300 :
((_baudrate == 600L ) ? b600 :
((_baudrate == 1200L ) ? b1200 :
((_baudrate == 2400L ) ? b2400 :
((_baudrate == 4800L ) ? b4800 :
((_baudrate == 9600L ) ? b9600 :
((_baudrate == 19200L ) ? b19k :
((_baudrate == 38400L ) ? b38k :
((_baudrate == 57600L ) ? b57k :
((_baudrate == 115200L) ? b115k : 0))))))))));
switch (_databits)
{
case 6 :
_pmask |= six ;
break;
case 7 :
_pmask |= seven;
break;
case 8 :
_pmask |= eight;
break;
default :
break;
}
switch (_parity)
{
case 'n':
case 'N':
_pmask |= none ;
break;
case 'e':
case 'E':
_pmask |= even ;
break;
case 'o':
case 'O':
_pmask |= odd ;
break;
case 'm':
case 'M':
_pmask |= mark ;
break;
case 's':
case 'S':
_pmask |= space;
break;
default :
break;
}
switch (_stopbits)
{
case 1 :
_pmask |= one ;
break;
case 2 :
_pmask |= two ;
break;
default:
break;
}
return (_pmask);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
char * FosIo::setupToString(unsigned int _setup, char * _s)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// A modem setting bitmask value, and optionally, a string to be
// filled with the converted mask.
//
// Return Value
//
// A pointer to a string containing the converted mask.
//
// Functional Description
//
// Takes a bitmask value and returns the settings in string form as:
//
// <baud_rate>,<data_bits>,<parity>,<stop_bits>
//
// eg.:
//
// "19200,8,N,1"
//
// The return value points to a static string that is overwritten with
// each call to ANY INSTANCE of the function. If a string is passed as
// a paramater, and is NOT NULL, it will be filled with a copy of the
// return value string. Max size, including the terminating NULL is 13.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
static char p[13];
unsigned long int _baudrate;
unsigned char _databits,
_stopbits;
unsigned char _parity;
setupToValues(_setup,_baudrate,_databits,_parity,_stopbits);
sprintf(p,"%-lu,%u,%c,%u",_baudrate,_databits,_parity,_stopbits);
if (_s != NULL)
strcpy(_s,p);
return (p);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void FosIo::setupToValues(unsigned int _setup,
unsigned long int & _baudrate,
unsigned char & _databits,
unsigned char & _parity,
unsigned char & _stopbits)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// A modem setup bitmask, and variable references for baud-rate,
// data-bits (word length), parity and stop-bits.
//
// Return Value
//
// None
//
// Functional Description
//
// Takes a bitmask and parses it into it's component parts.
//
// Remarks
//
// Variables are passed BY REFERENCE ala Pascal VAR!
// The parity paramater returns an ASCII character like 'E' == even.
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
switch (_setup & bmask)
{
case b300 :
_baudrate = 300UL;
break;
case b600 :
_baudrate = 600UL;
break;
case b1200 :
_baudrate = 1200UL;
break;
case b2400 :
_baudrate = 2400UL;
break;
case b4800 :
_baudrate = 4800UL;
break;
case b9600 :
_baudrate = 9600UL;
break;
case b19k :
_baudrate = 19200UL;
break;
case b38k :
_baudrate = 38400UL;
break;
case b57k :
_baudrate = 57600UL;
break;
case b115k :
_baudrate = 115200UL;
break;
default:
_baudrate = 0UL;
break;
}
switch (_setup & pmask)
{
case even :
_parity = 'E';
break;
case odd :
_parity = 'O';
break;
case mark :
_parity = 'M';
break;
case none :
default:
_parity = 'N';
break;
}
switch (_setup & dmask)
{
case six :
_databits = 6;
break;
case seven :
_databits = 7;
break;
case eight :
default:
_databits = 8;
break;
}
switch (_setup & smask)
{
case two :
_stopbits = 2;
break;
case one :
default:
_stopbits = 1;
break;
}
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Constructor //
Fossil::Fossil() : FosIo()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// None.
//
// Functional Description
//
// Default constructor
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
initialised = 0;
}
// Constructor //
Fossil::Fossil(unsigned int _port, unsigned int _cbrk) : FosIo()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Commport number (1 based) and optionally a boolean toggle
// for control-break counting.
//
// Return Value
//
// True if successful.
//
// Functional Description
//
// Initialises FOSSIL and gets information about same.
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
open(_port,_cbrk);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Constructor //
Fossil::Fossil(unsigned int _port, unsigned char _mask, unsigned int _cbrk) :
FosIo()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// As default, but adds a port setup bitmask.
//
// Return Value
//
// As default.
//
// Functional Description
//
// As default constructor, but also initialises the serial port.
//
// Remarks
//
// See default constructor.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
open(_port,_mask,_cbrk);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Constructor //
Fossil::Fossil(unsigned int _port, char * _initstr,
unsigned int _cbrk) : FosIo()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// As default, but adds a port setup configuration string.
//
// Return Value
//
// As default.
//
// Functional Description
//
// As default constructor, but also initialises the serial port.
//
// Remarks
//
// See default constructor.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
open(_port,_initstr,_cbrk);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Constructor //
Fossil::Fossil(unsigned int _port, unsigned long int _baud,
unsigned char _data, unsigned char _pari,
unsigned char _stop, unsigned int _cbrk) : FosIo()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// As default, but adds a port setup values.
//
// Return Value
//
// As default.
//
// Functional Description
//
// As default constructor, but also initialises the serial port.
//
// Remarks
//
// See default constructor.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
open(_port,_baud,_data,_pari,_stop,_cbrk);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Destructor //
Fossil::~Fossil()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// None.
//
// Functional Description
//
// Class destructor. Calls close() to de-initialise the FOSSIL.
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
close();
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::open(unsigned int _port, unsigned char _mask,
unsigned int _cbrk)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// See equivalent constructor.
//
// Return Value
//
// Ditto.
//
// Functional Description
//
// Ditto.
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
commport = _port - 1;
if (_initialise(((_cbrk) ? &ctlcnt : NULL)))
set(_mask);
return (initialised);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::open(unsigned int _port, char * _initstr,
unsigned int _cbrk)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// See equivalent constructor.
//
// Return Value
//
// Ditto.
//
// Functional Description
//
// Ditto.
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
return (open(_port,stringToSetup(_initstr),_cbrk));
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::open(unsigned int _port, unsigned long int _baud,
unsigned char _data, unsigned char _pari,
unsigned char _stop, unsigned int _cbrk)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// See equivalent constructor.
//
// Return Value
//
// Ditto.
//
// Functional Description
//
// Ditto.
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
return (open(_port,valuesToSetup(_baud,_data,_pari,_stop),_cbrk));
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::close()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// None.
//
// Functional Description
//
// Call _deInitialise to shut down the FOSSIL.
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_deInitialise();
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::set(unsigned char _mask)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// A serial commport configuration bitmask ala PC/MS-DOS with minor
// exceptions for higher baudrates. See the FOSSIL-5 spec and
// the accompanying header file for details.
//
// Return Value
//
// Serial commport status bitmask.
//
// Functional Description
//
// Set comm commport baud, parity, data and stopbits.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
portmask = _mask;
_DX = commport;
_AL = _mask;
_AH = 0x00;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::putW(unsigned char _c)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// A character or byte to be transmitted.
//
// Return Value
//
// A serial commport status bitmask.
//
// Functional Description
//
// Transmit a character with wait for buffer.
//
// Remarks
//
// NO ERROR CHECKING!
// WAITS FOR ROOM IN THE BUFFER - conceivably FOREVER!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AL = _c;
_AH = 0x01;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned char Fossil::getW()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// Character (byte) from FOSSIL input buffer.
//
// Functional Description
//
// Gets a character from the input buffer - waits for one to
// become available if neccessary.
//
// Remarks
//
// NO ERROR CHECKING!
// Waits for a character, possibly FOREVER!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AH = 0x02;
geninterrupt(0x14);
return (_AL);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::status()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// Serial commport status bitmask.
//
// Functional Description
//
// Gets the serial commport status.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AH = 0x03;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::_initialise(unsigned char far * _countc)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// An optional pointer to a ^C-press counter byte.
//
// Return Value
//
// True (non-zero) on success.
//
// Functional Description
//
// Initialises the FOSSIL driver. If "_countc" is supplied and
// is NOT NULL, then the byte it points to will be incremented
// each time a control-c is pressed at the keyboard - this is
// not normally needed.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_ES = FP_SEG(&ctlcnt);
_CX = FP_OFF(&ctlcnt);
if (_countc != NULL)
_BX = 0x4F50 ;
else
_BX = 0x00;
_DX = commport;
_AH = 0x04;
geninterrupt(0x14);
maxfunc = _BL;
revision = _BH;
#pragma warn -pia
if (initialised = (_AX == 0x1954) ? 1 : 0)
#pragma warn .pia
{
_getTicks(*this);
_info(*this);
return (1);
}
return (0);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::_deInitialise()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// None.
//
// Functional Description
//
// De-initialises the FOSSIL driver.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AH = 0x05;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned char Fossil::dtr(unsigned int _raise)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Boolean "_raise"
//
// Return Value
//
// True if DTR high.
//
// Functional Description
//
// Sets the ports Data Terminal Ready (DTR) line. Raises signal
// if "_raise" is true.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AL = (_raise) ? 1 : 0;
_AH = 0x06;
geninterrupt(0x14);
return (_AL);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::_getTicks(TimInfo & T)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// TimInfo structure.
//
// Return Value
//
// None.
//
// Functional Description
//
// Fills TimInfo structure with system timer information. Since
// TimInfo is a parent class of Fossil, this routine is called
// internally on initialisation as: getTicks(*this) to fill
// in the data fields.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_AH = 0x07;
geninterrupt(0x14);
T.intnum = _AL;
T.ticpersec = _AH;
T.mspertic = _DX;
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::flushOut()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// None.
//
// Functional Description
//
// Flushes the output buffer.
//
// Remarks
//
// NO ERROR CHECKING!
// Doesn't return until the output buffer is empty!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AH = 0x08;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::purgeOut()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// None.
//
// Functional Description
//
// Purges the output buffer.
//
// Remarks
//
// NO ERROR CHECKING!
// Destroys anything left in the buffer!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AH = 0x09;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::purgeIn()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// None.
//
// Functional Description
//
// Purges the input buffer.
//
// Remarks
//
// NO ERROR CHECKING!
// Destroys anything left in the buffer!
// Will clear XOFF and/or raise RTS
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AH = 0x0A;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::put(unsigned char _c)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// A character or byte to be sent.
//
// Return Value
//
// True if character was "sent."
//
// Functional Description
//
// Outputs a character to the output buffer, if room is available.
// Does NOT wait for the buffer... if there isn't room, the call fails.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AL = _c;
_AH = 0x0B;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::peek()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// Low byte == next character in buffer if one is available, else
// returns 0FFFFh.
//
// Functional Description
//
// Non destructive "look ahead" into the comm input buffer.
//
// Remarks
//
// NO ERROR CHECKING!
// Does NOT remove any pending characters from the buffer.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AH = 0x0C;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::peekKey()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// Low byte == next character in buffer if one is available, else
// returns 0FFFFh. High byte == scancode if extended character.
//
// Functional Description
//
// Non destructive "look ahead" into the keyboard buffer.
//
// Remarks
//
// NO ERROR CHECKING!
// Does NOT remove any pending characters from the buffer.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_AH = 0x0D;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::getKey()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// Low byte = next character from keyboard. High byte contains
// scancodes for extended characters.
//
// Functional Description
//
// Gets the next character from the keyboard - waits until one
// becomes available.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_AH = 0x0E;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::flow(unsigned char _mask)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Flow control bitmask.
//
// Return Value
//
// None.
//
// Functional Description
//
// Enables/disables various flow control settings. See FOSSIL spec. or
// header file for more information.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AL = _mask;
_AH = 0x0F;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::control(unsigned char _mask)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Bitmask indicating check on/off and possibly force release
// of controls. See FOSSIL spec or header file for more
// information.
//
// Return Value
//
// True if ^C or ^K has been detected since the last call to this
// function.
//
// Functional Description
//
// Turns on/off ^C/^K checking, returns status of same if enabled,
// and also can force a transmitter stop/release (good for keeping
// spurious control characters from hanging the system).
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AL = _mask;
_AH = 0x10;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::gotoXY(unsigned char _row, unsigned char _col)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Screen row and column to position the on.
//
// Return Value
//
// None.
//
// Functional Description
//
// Position the cursor on the screen.
//
// Remarks
//
// NO ERROR CHECKING!
// Row/col are zero (0) based!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DH = _row;
_DL = _col;
_AH = 0x11;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::whereXY(unsigned char & _row, unsigned char & _col)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Variables to fill with cursor row and column positions.
//
// Return Value
//
// None.
//
// Functional Description
//
// Get the cursor position.
//
// Remarks
//
// NO ERROR CHECKING!
// Row/col are zero (0) based!
// Variables are passed BY REFERENCE! Don't do a 'C' style
// whereXY(&row,&col) unless you like bogus screen positions!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_AH = 0x12;
geninterrupt(0x14);
_row = _DH;
_col = _DL;
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::putANSI(unsigned char _c)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Character to output to screen.
//
// Return Value
//
// None.
//
// Functional Description
//
// Output a character to the screen via ANSI.SYS
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_AL = _c;
_AH = 0x13;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::watchdog(unsigned int _enable)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Boolean: True == enable watchdog.
//
// Return Value
//
// None.
//
// Functional Description
//
// Enables or disables FOSSIL carrier watchdog.
//
// Remarks
//
// NO ERROR CHECKING!
// Not changed by init/de-init code... be careful if you exit
// your program and have left this enabled: You may get reboots
// where you didn't want or expect them.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AL = (_enable) ? 1 : 0;
_AH = 0x14;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::putBIOS(unsigned char _c)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Character to output to screen.
//
// Return Value
//
// None.
//
// Functional Description
//
// Output a character to the screen via BIOS.
//
// Remarks
//
// NO ERROR CHECKING!
// Reentrancy is allegedly o.k. via this routine, but who
// really knows? ;-)
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_AL = _c;
_AH = 0x15;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::timerChain(unsigned int _insert, void (far * _f)())
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Boolean switch for add/remove, and the function pointer
// to be added/removed.
//
// Return Value
//
// True if successful.
//
// Functional Description
//
// Inserts or deletes a user-specified function into/from the
// timer-tick interrupt chain.
//
// Remarks
//
// NO ERROR CHECKING!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_ES = FP_SEG(_f);
_DX = FP_OFF(_f);
_AL = (_insert) ? 1 : 0;
_AH = 0x16;
geninterrupt(0x14);
return ((_AX) ? 1 : 0);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::reboot(unsigned int _warm)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Boolean switch for warm/cold.
//
// Return Value
//
// None I should hope! ;-)
//
// Functional Description
//
// Force a system reboot, either warm or cold.
//
// Remarks
//
// If you don't understand this one, you shouldn't be reading
// this at all! ;-)
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_AL = (_warm) ? 1 : 0;
_AH = 0x17;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::read(void far * _buffer, unsigned int _count)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// A pointer to the buffer to fill, and the number of bytes/chars to
// read.
//
// Return Value
//
// The actual number of characters read.
//
// Functional Description
//
// Reads up to "_count" characters into "_buffer" from the
// comm input buffer.
//
// Remarks
//
// NO ERROR CHECKING!
// Does not wait for characters! If less than "_count"
// are available, it will only return that many.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_ES = FP_SEG(_buffer);
_DX = FP_OFF(_buffer);
_CX = _count;
_DX = commport;
_AH = 0x18;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::write(void far * _buffer, unsigned int _count)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// A pointer to the buffer to fill, and the number of bytes/chars to
// write.
//
// Return Value
//
// The actual number of characters sent.
//
// Functional Description
//
// Writes up to "_count" characters from "_buffer" to the
// comm output buffer.
//
// Remarks
//
// NO ERROR CHECKING!
// Does not wait for buffer space! If less than "_count"
// are available, it will only output that many.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_ES = FP_SEG(_buffer);
_DX = FP_OFF(_buffer);
_CX = _count;
_DX = commport;
_AH = 0x19;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::brk(unsigned int _start)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Boolean indicating start/stop.
//
// Return Value
//
// None.
//
// Functional Description
//
// Starts/stops sending a break signal.
//
// Remarks
//
// NO ERROR CHECKING!
// Flow control commands will stop a break!
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_DX = commport;
_AL = (_start) ? 1 : 0;
_AH = 0x1A;
geninterrupt(0x14);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::_info(FosData & _D)
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// A FosData structure.
//
// Return Value
//
// The actual number of bytes transferred to the structure.
//
// Functional Description
//
// Fills a FosInfo structure with the FOSSIL driver information.
//
// Remarks
//
// NO ERROR CHECKING!
// Intended for internal useto fill the base class FosData
// variables: info(*this); This is automagically done on
// initialization.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_CX = sizeof(FosData);
_ES = FP_SEG(&_D);
_DI = FP_OFF(&_D);
_DX = commport;
_AH = 0x1B;
geninterrupt(0x14);
return (_AX);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::installApi(unsigned char _code, void (far * _f)())
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Subfunction number that will call this function,
// and a pointer to the user function.
//
// Return Value
//
// True if user function installed successfully.
//
// Functional Description
//
// Install a user API.
//
// Remarks
//
// The installed function is callable as a FOSSIL subfunction,
// by specifying the subfunction number from "_code."
// See FOSSIL spec for furthur information.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_ES = FP_SEG(_f);
_DX = FP_OFF(_f);
_AL = _code;
_AH = 0x7F;
geninterrupt(0x14);
return (((_AX == 0x1954) && (_BH)) ? 1 : 0);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::removeApi(unsigned char _code, void (far * _f)())
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// Subfunction number for this function
// and a pointer to the user function.
//
// Return Value
//
// True if user function removed successfully.
//
// Functional Description
//
// Remove a user API.
//
// Remarks
//
// See installApi() above.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_ES = FP_SEG(_f);
_DX = FP_OFF(_f);
_AL = _code;
_AH = 0x7F;
geninterrupt(0x14);
return (((_AX == 0x1954) && (_BH)) ? 1 : 0);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Operator //
unsigned int Fossil::operator ! ()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// True if an error condition exists.
//
// Functional Description
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
return ((!initialised) ? 1 : 0);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::carrier()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// True if data carrier detect line is high.
//
// Functional Description
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
return ((status() & FosIo::dcd) ? 1 : 0);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::incoming()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// True if there is data in the receive buffer.
//
// Functional Description
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
return ((status() & FosIo::rxr) ? 1 : 0);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
void Fossil::info()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// None.
//
// Functional Description
//
// Performs an update on the member data in struct FosData.
//
// Remarks
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
_info(*this);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Member Function //
unsigned int Fossil::mode()
// Summary =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Paramaters
//
// None.
//
// Return Value
//
// The current bitmask settings for the comm port in use.
//
// Functional Description
//
// Just returns the mask.
//
// Remarks
//
// Use the FosIo conversion functions to make this meaningful
// to carbon based sentient beings.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
{
return (portmask);
}
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=